﻿using _3_2;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _3_2
{
    public class Building
    {
        private double length;   
        private double width;    
        private int floors;      
        private double unitPrice;

     
        public Building(double length, double width, int floors)
        {
            this.length = length;
            this.width = width;
            this.floors = floors;
        }

        
        public double UnitPrice
        {
            set { unitPrice = value; }
        }

      
        public double CalculateArea()
        {
            return length * width * floors;
        }

      
        public double CalculateTotalPrice()
        {
            return CalculateArea() * unitPrice;
        }
    }
}
namespace sy3_2
{
    class Program
    {
        static void Main(string[] args)
        {
            
            Console.Write("请输入楼房长(米)：");
            double length = Convert.ToDouble(Console.ReadLine());

            Console.Write("请输入楼房宽(米)：");
            double width = Convert.ToDouble(Console.ReadLine());

            Console.Write("请输入楼层数(层)：");
            int floors = Convert.ToInt32(Console.ReadLine());

           
            Building building = new Building(length, width, floors);

            
            Console.Write("请输入楼单价(万)：");
            double unitPrice = Convert.ToDouble(Console.ReadLine());
            building.UnitPrice = unitPrice;

            
            Console.WriteLine("\n========以下是输出========");
            Console.WriteLine($"楼房总面积为(平方)：{building.CalculateArea()}");
            Console.WriteLine($"楼房总价格为(万元)：{building.CalculateTotalPrice()}");

            Console.WriteLine("\n按任意键结束程序：");
            Console.ReadKey();
        }
    }
}